package com.captain.special.字符串;

/**
 * Des:
 *
 * @author XL
 * @Date 2022/4/5 17:36
 */
public class 左旋转字符串Offer58 {
    public static void main(String[] args) {
        System.out.println(new 左旋转字符串Offer58().reverseLeftWords("lrloseumgh", 6));

    }

    public String reverseLeftWords(String s, int n) {
        if (n > s.length()) return s;
        //截断
        char[] chars = s.toCharArray();
        String pre = new String(chars, 0, n);
        String back = new String(chars, n, s.length() - n);
        return back + pre;
    }
}
